package com.ruoyi.mes.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mes.mapper.MesFactoryMapper;
import com.ruoyi.mes.domain.MesFactory;
import com.ruoyi.mes.service.IMesFactoryService;

/**
 * 工厂Service业务层处理
 * 
 * @author jhaosui
 * @date 2020-09-21
 */
@Service
public class MesFactoryServiceImpl implements IMesFactoryService 
{
    @Autowired
    private MesFactoryMapper mesFactoryMapper;

    /**
     * 查询工厂
     * 
     * @param id 工厂ID
     * @return 工厂
     */
    @Override
    public MesFactory selectMesFactoryById(Long id)
    {
        return mesFactoryMapper.selectMesFactoryById(id);
    }

    /**
     * 查询工厂列表
     * 
     * @param mesFactory 工厂
     * @return 工厂
     */
    @Override
    public List<MesFactory> selectMesFactoryList(MesFactory mesFactory)
    {
        return mesFactoryMapper.selectMesFactoryList(mesFactory);
    }

    /**
     * 新增工厂
     * 
     * @param mesFactory 工厂
     * @return 结果
     */
    @Override
    public int insertMesFactory(MesFactory mesFactory)
    {
        mesFactory.setCreateTime(DateUtils.getNowDate());
        return mesFactoryMapper.insertMesFactory(mesFactory);
    }

    /**
     * 修改工厂
     * 
     * @param mesFactory 工厂
     * @return 结果
     */
    @Override
    public int updateMesFactory(MesFactory mesFactory)
    {
        mesFactory.setUpdateTime(DateUtils.getNowDate());
        return mesFactoryMapper.updateMesFactory(mesFactory);
    }

    /**
     * 批量删除工厂
     * 
     * @param ids 需要删除的工厂ID
     * @return 结果
     */
    @Override
    public int deleteMesFactoryByIds(Long[] ids)
    {
        return mesFactoryMapper.deleteMesFactoryByIds(ids);
    }

    /**
     * 删除工厂信息
     * 
     * @param id 工厂ID
     * @return 结果
     */
    @Override
    public int deleteMesFactoryById(Long id)
    {
        return mesFactoryMapper.deleteMesFactoryById(id);
    }
}
